<%--
  Created by IntelliJ IDEA.
  User: SYHT
  Date: 2017/5/12
  Time: 16:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="page" uri="/xianzhiOA/pageTag" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <jsp:include page="documentForeEnd.jsp"/>
    <link href="${pageContext.request.contextPath}/dist/foreEnd/css/bootstrap.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/foreEnd/css/common.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/date.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/iscroll.js"></script>

    <script src="${pageContext.request.contextPath}/dist/foreEnd/js/highchart.js"></script>
    <style type="text/css">
        a:link {
            text-decoration: none;
        }
        a:visited {
            text-decoration: none;
        }
    </style>
    <script type="text/javascript">
        var tis = new tis(300);
        $(function () {
            $('#search12').date();
            $('#endTime').date({theme: "datetime"});
        });
    </script>

    <script>
        function changeCss(obj,name,id){
            var alist = document.getElementsByTagName("a");
            for(var i =0;i < alist.Length;i++){
                alist[i].style.color = "#000";
            }
            obj.style.color = "#3a1b0e";

            $('#myModal').modal('hide');
            document.getElementById("search9").value=name;
            document.getElementById("empId").value=id;
        }
        function rrn(event,inp) {
            if(13 == event.keyCode){
                console.log(inp.value);
                $.ajax({
                    url:'${pageContext.request.contextPath}/XzEmp/selectByName.do',
                    data:{'empName':inp.value},
                    type:'post',
                    dataType:'json',
                    success:function (data) {
                        if(data.xzEmpInfo!=""){
                            var nameRs = document.getElementById("nameRs");
                            var str = "";
                            for(var i=0;i<data.xzEmpInfo.length;i++){
                                str+="<li><a onclick='changeCss(this,\""+data.xzEmpInfo[i].empName+"\","+data.xzEmpInfo[i].empId+")'><span>"+data.xzEmpInfo[i].empName+"</span></a></li>";
                            }
                            nameRs.innerHTML = str;
                        }
                    }
                });
            }
        }
    </script>
    <script type="application/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/censusBar.js"></script>
    <script>
        $(function () {
            var rs1 = JSON.parse('${rs1}');
            var rs2 = JSON.parse('${rs2}');
            var rs3;
            var rs4;
            if('${rs3}'!=""){
                rs3 = JSON.parse('${rs3}');
            }
            if('${rs4}'!=""){
                rs4 = JSON.parse('${rs4}');
            }

            var xData = [
                '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11',
                '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'
                , '24', '25', '26', '27', '28', '29', '30', '31'];
            var yData = [0, 10, 20, 30, 40];
            if('${cycle}'=='year'){
                xData = ['一月', '二月', '三月', '四月', '五月','六月','七月',
                    '八月', '九月', '十月', '十一月','十二月'];
                yData = [0, 200, 400, 600, 800];
            }

            var cData;
            var title = "";
            if('${type}'=='hqgz'){
                title = "后期跟踪";
                cData = [{
                    name: '没来',
                    data: rs1,
                    color:'#ed687c'
                }, {
                    name: '待命',
                    data: rs2,
                    color:'#8DC2BC'
                },{
                    name: 'pass',
                    data: rs3,
                    color:'#666666'
                }, {
                    name: '通过',
                    data: rs4,
                    color:'#3a1b0e'
                }]
            }else if('${type}'=='cbsc'){
                title = "初步筛查";
                cData = [{
                    name: '合格',
                    data:rs1,
                    color:'#ed687c'
                }, {
                    name: '不合格',
                    data: rs2,
                    color:'#8DC2BC'
                }]
            }
            toCensusBar(title,"人数",xData,yData,cData);

        })
    </script>
</head>
<body>
<header>
    <jsp:include page="headerForeEnd2.jsp"/>
</header>
<div class="container">

    <!--搜索框-->
    <div class="allsearch col-l-12">
        <form action="${pageContext.request.contextPath}/Person/Census.do" method="post">
            <div action="#" id="search_box9" class="col-md-2" style="margin-right: 20px">
                <input type="text" id="search9" name="cEmpName" value="${cEmpName}" placeholder=" 员工姓名" autocomplete="off" style="position: relative" readonly="readonly"/>
                <a data-toggle="modal" data-target="#myModal" class="select_a"><span class="fa fa-search-plus" style="color: white"></span>
                </a>
            </div>
            <input id="empId" type="hidden" name="cEmpId" value="${cEmpId}">
            <div id="search_box10" class="col-md-3">
                <select name="cycle" id="search10" style="height: 34px">
                    <option selected="selected" value="">查询类别</option>
                    <option <c:if test="${cycle=='month'}">selected="selected"</c:if>  value="month">按月查</option>
                    <option <c:if test="${cycle=='year'}">selected="selected"</c:if>  value="year">按年查</option>
                </select>
            </div>

            <div id="search_box11" class="col-md-3">
                <select name="type" id="search11" style="height: 34px">
                    <option selected="selected" value="cycle">查询区间</option>
                    <option <c:if test="${type=='cbsc'}">selected="selected"</c:if>  value="cbsc">初步筛查</option>
                    <option <c:if test="${type=='hqgz'}">selected="selected"</c:if> value="hqgz">后期跟踪</option>
                </select>
            </div>

            <div id="search_box6" class="col-md-3">
                <input id="search12" name="selTime" value="<fmt:formatDate value="${selTime}" type="both"
                                            pattern="yyyy-MM-dd"/>" placeholder="时间" style="position: relative" style="height: 34px"/>
                <button type="submit" class="search_btn" style="position: absolute;right: -50px;top: -5px"><span class="fa fa-search" style="color: white"></span>
                </button>
            </div>
        </form>
    </div>
    <div style="clear: both"></div>
    <div id="chart1" style="margin-top: 50px"></div>
    <div id="datePlugin"></div>
</div>


<%--单一简历上传模态框--%>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-top: 200px">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    姓名搜索
                </h4>
            </div>
            <div class="modal-body">
                姓名：
                <input type="text" class="modal_in" onkeydown="rrn(event,this)">
                <div class="modal_sp">
                    <ul id="nameRs" style="height: 200px;overflow-y:auto;cursor: pointer">
                        <li><a onclick="changeCss(this)"><span></span></a></li>

                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button"  class="button_s">
                    提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
</html>